﻿var myData = new Array(4);
for (var i = 0; i < 7; i++) {
    myData[i] = ["", ""];
}
var ds = Ext.create('Ext.data.ArrayStore', {
    fields: ["ma", "ten"],
    data: myData
});

var grid = Ext.create('Ext.grid.Panel', {
    id: 'qt_dtpt',
    width: 920,
    hight: 300,
    store: ds,
    plugins: Ext.create('Ext.grid.plugin.CellEditing', {
        clicksToEdit: 1
    }),
    columns: [{
        id: 'ma_truong',
        text: 'Mã trường',
        flex: 1,
        width: 240,
        sortable: true,
        dataIndex: 'ma',
        editor: {
            allowBlank: true
        }
    },
    {
        text: 'Tên trường',
        width: 700,
        sortable: true,
        dataIndex: 'ten',
        editor: {
            allowBlank: true
        }
    }],
    columnLines: true,
    viewConfig: {
        stripeRows: true,
        deferEmptyText: false,
        emptyText: 'Không có bản ghi',
        style: { overflow: 'auto', overflowX: 'hidden' }
    },
    frame: false,
    iconCls: 'icon-grid',
    renderTo: Ext.getBody()
});